<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{completed:completed}" >
      <div class="view">
        <input v-model="completed" class="toggle" type="checkbox" />
        <label>{{title}}</label>
        <button class="destroy" @click="del(id)"></button>
      </div>
    </li>
  </ul>

</template>

<script>
export default {
  data () {
    return {

    }
  },
  props: ['id', 'title', 'completed'],
  created () {

  },

  methods: {
    del (id) {
      this.$emit('delList', id)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
